/*
* popupwnd.h - This file is the part of the Miscellaneous Files.
* Copyright (C) 2010 Dean Lee <deanlee3@gmail.com>, http://www.deanlee.cn
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
* 
* Acknowledgements:
*   <> Many thanks to all of you, who have encouraged me to update my articles
*     and code, and who sent in bug reports and fixes.
* 
*/
#ifndef POPUPWND_H
#define POPUPWND_H
#include <QFrame>
#include "blog.h"
class QTimer;
class QLabel;
class Blog;
class PopupWnd: public QFrame
{
	Q_OBJECT
public:
	PopupWnd(const Blog& blog);
	~PopupWnd();
	void show();
	Blog blog()const{return m_blog;}
	void setMessage(const QString& message);
	void restartHideTimer();

signals:
	void clicked(int);
protected:

	QPoint position();
	bool eventFilter(QObject * watched, QEvent * event);
	void hideEvent(QHideEvent *);
	void mouseReleaseEvent(QMouseEvent *);
	QTimer *m_hideTimer;
	QLabel *m_message;
	Blog m_blog;
	QList<PopupWnd*> m_prevPopups;
};

#endif